package com.bowos.zmado.web;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bowos.utils.RenderUtils;
import com.bowos.zmado.service.ValidateCodeManager;

/**
 * {@link ValidateCodeManager}该类处理的WEB层
 * @author Administrator
 *
 */
@Controller @Scope("request")
public class ValidateImageController {
	@Autowired
	private ValidateCodeManager validateCodeManager;
	
	@RequestMapping(method=RequestMethod.GET, value="/validateImage")
	@ResponseBody
	public void getValidateImage(HttpServletResponse response) throws IOException{
		RenderUtils.renderImage(response, validateCodeManager.getImage());
	}
}
